package net.xdclass.manager;

import net.xdclass.enums.ShortLinkStateEnum;
import net.xdclass.model.GroupCodeMappingDO;

import java.util.Map;

public interface GroupCodeMappingManager {

    /**
     * 根据短链码查询
     * @param groupId
     * @param accountNo
     * @param mappingId
     * @return
     */
    GroupCodeMappingDO findByGroupIdAndMappingId(Long groupId,Long accountNo,Long mappingId);

    /**
     *  新增
     * @param groupCodeMappingDO
     * @return
     */
    int add(GroupCodeMappingDO groupCodeMappingDO);

    /**
     * 删除根据短链码
     * @param shortLinkCode
     * @param accountNo
     * @param groupId
     * @return
     */
    int del(String shortLinkCode, Long accountNo, Long groupId);

    /**
     * 分页查询短链码
     * @param page
     * @param size
     * @param groupId
     * @param accountNo
     * @return
     */
    Map<String,Object> pageShortLinkByGroupId(int page, int size, Long groupId, Long accountNo);

    /**
     * 更新短链码状态
     * @param shortLinkCode
     * @param stateEnum
     * @param accountNo
     * @param groupId
     * @return
     */
    int updateGroupCodeMappingState(String shortLinkCode, ShortLinkStateEnum stateEnum, Long accountNo, Long groupId);

    GroupCodeMappingDO findByCodeAndGroupId(String shortLinkCode, Long id, Long accountNo);

    int update(GroupCodeMappingDO groupCodeMappingDO);

    int del(GroupCodeMappingDO groupCodeMappingDO);
}
